UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aUXg7MmLoDA0evoUQYaINPLkWRIOdRPNvI1ppc/bbd8='
WHERE
key_id = 'c37db4c815f6ebd1c29dcd2b355065516486f3f0e6a6061e0e573ecd86f1a788'
AND (
token = 'aUXg7MmLoDA0evoUQYaINPLkWRIOdRPNvI1ppc/bbd8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)