UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DHhqhyNy3jgkQJ0yldll3h8BxnY4f0wyVQbgsDqYv60=' 
WHERE 
  key_id = '7e08a7d7930b3349c7fe44f701f8b9a8850711e34eeccf22b9836c18e2b61c04' 
  AND (
    token = 'DHhqhyNy3jgkQJ0yldll3h8BxnY4f0wyVQbgsDqYv60=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033