UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rEOiFKipghEuhZae9wkLMarYFsE7obDi44iHjBJtcZY=' 
WHERE 
  key_id = 'f7175a7f99290a77e7b078188d95bc46c9f4b6ccbd5c195ea8c2865f839c43ea' 
  AND (
    token = 'rEOiFKipghEuhZae9wkLMarYFsE7obDi44iHjBJtcZY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044