UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wXRjRx3B/5tvOeqPbT50sV+liu1413YL3ebwzbZQj/Y='
WHERE
key_id = '453539941c43c6375713473e9842c15ee6b2f4aa93c0a23a3f0606008fcf7b8e'
AND (
token = 'wXRjRx3B/5tvOeqPbT50sV+liu1413YL3ebwzbZQj/Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)