UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c2bAVoHYlQcyNrhHNqAmWDMFdJUsKAf9dfUD03GhT6Q=' 
WHERE 
  key_id = '2ebfc45ff8529bcd8d80ab4f6b41fa8eea83b104453b2b5ad57bf0bbde24d49f' 
  AND (
    token = 'c2bAVoHYlQcyNrhHNqAmWDMFdJUsKAf9dfUD03GhT6Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021