UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xNmGrfeXQc7YzVQNylIMZi0/60ojQ0QpOhN8eZ9dE1Q=' 
WHERE 
  key_id = '392cf64d48ddd3269ca5a3948251cfb4e3aecf41025d1d95d933cff44b69c2d8' 
  AND (
    token = 'xNmGrfeXQc7YzVQNylIMZi0/60ojQ0QpOhN8eZ9dE1Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041