UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vZmG2H2zZlEuTqwE0JWOGJg9rDpF762PSyedSSl3WTc=' 
WHERE 
  key_id = 'ce64553c5dd27569a4d79ef5137021133b8d5067396d7304e587987a46e616b1' 
  AND (
    token = 'vZmG2H2zZlEuTqwE0JWOGJg9rDpF762PSyedSSl3WTc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00083