UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YlnngpGE4ge5B3axgOn8xcSEjWj0QWWlnUeBwOfE5BQ=' 
WHERE 
  key_id = '02679b6d73251fd264539692030862a881a3f36d9d8dc9a0327fc1f0db4fe40c' 
  AND (
    token = 'YlnngpGE4ge5B3axgOn8xcSEjWj0QWWlnUeBwOfE5BQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026