UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UwIeNLlIgBImlYS+5FxDsL0Nme5LoQ1WV6eXjV2FYBU='
WHERE
key_id = '64c833146f0761b8b1310b6d1573912afa038a0af2b624745cdd18f1f65ad876'
AND (
token = 'UwIeNLlIgBImlYS+5FxDsL0Nme5LoQ1WV6eXjV2FYBU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)