UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rMaLqijFwUGnkPXkp+6L85xPJYWP8j2xC/0H4BZgkWk=' 
WHERE 
  key_id = 'a663835f457ad47bcc9c7feff45b0ce58e3ac7fd278fb076dfa394ee28c36b94' 
  AND (
    token = 'rMaLqijFwUGnkPXkp+6L85xPJYWP8j2xC/0H4BZgkWk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029