UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tlk7uFZ0rOB1yb4VzzZ56eQVYeLz0mvB7awwrz1zKDo=' 
WHERE 
  key_id = '8577c1800d8f3b3532880e8a0e0064ed5ade7e9c9b409fc9aa2dcaca6358fbcb' 
  AND (
    token = 'tlk7uFZ0rOB1yb4VzzZ56eQVYeLz0mvB7awwrz1zKDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023