UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f8ZiGRMrelIeua+LEFFFp7nfh5j46CTPOyK0MMl2scE=' 
WHERE 
  key_id = '0743f32d143f3b9f4b3dc4a8c3a21acefe0602011f41bb825d16af806af94ee2' 
  AND (
    token = 'f8ZiGRMrelIeua+LEFFFp7nfh5j46CTPOyK0MMl2scE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029