UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M60MshQFI+Udsibg0saQLb0ZNgdNh7/TXobx5uHTrL8=' 
WHERE 
  key_id = '425e37a15e479763deacc877d44e1ed43cd06efa786bbc9837d63970ea495c49' 
  AND (
    token = 'M60MshQFI+Udsibg0saQLb0ZNgdNh7/TXobx5uHTrL8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047