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

Query time 0.00015