UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L3ESN0M/DYKn2TVFy8jsmcnuuiOPcEEW5X0YWRA6Mtc='
WHERE
key_id = '03039b89454f23f9301e9cb0191fd3e2adcf187f63f1b4fd2db473c07bfef3f7'
AND (
token = 'L3ESN0M/DYKn2TVFy8jsmcnuuiOPcEEW5X0YWRA6Mtc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)