UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MwcBV3otD8vFgEkGVy5lw/mvR2puH8E/IvoR+OyTss0=' 
WHERE 
  key_id = '66e14a16675dd1842beeec274f0e7a370e227468017470ce972fa65eb4ece2c2' 
  AND (
    token = 'MwcBV3otD8vFgEkGVy5lw/mvR2puH8E/IvoR+OyTss0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027