UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AlV7eoTv6JTZB6kVW/R7o47sEEYGR/SiB/FV8/T/LGg='
WHERE
key_id = '469b174fb2f59e0852c414070710e98be4f14413478593c9992f733a59d096e8'
AND (
token = 'AlV7eoTv6JTZB6kVW/R7o47sEEYGR/SiB/FV8/T/LGg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)