UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HHh2u1WoVWntPykFNecQB/Fb/9Ly4ri6puohjChIsRo=' 
WHERE 
  key_id = 'ea5b9ee2dd4da8a169403c682b2033a473fca946319b045131b9380190853c1a' 
  AND (
    token = 'HHh2u1WoVWntPykFNecQB/Fb/9Ly4ri6puohjChIsRo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024