UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U0rktepL/QnfIgiGwTStoHNZz/VMnDZHt8r2kVBuBvA=' 
WHERE 
  key_id = '2f0444c843d9a45d715d2099f25db641fed83f3085ee1834865bb9616d10dc40' 
  AND (
    token = 'U0rktepL/QnfIgiGwTStoHNZz/VMnDZHt8r2kVBuBvA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031