UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vsjSBpg9996ymz1oH5gOz5MVKy3auWv8SCQM+f9BF8Q=' 
WHERE 
  key_id = '80fb71b5ebe89155b11ee74859ebfc6a840f322dc032ec7d0ffb55304550bb8b' 
  AND (
    token = 'vsjSBpg9996ymz1oH5gOz5MVKy3auWv8SCQM+f9BF8Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021