UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bIMkfvMTTJA22EehFn9ZvrfL8+JJHq54oHwUZPFLvB4='
WHERE
key_id = '6d908ee6b1c10631b0806e9240f990bf98a8be86943e1bed209a76ddff1ad29e'
AND (
token = 'bIMkfvMTTJA22EehFn9ZvrfL8+JJHq54oHwUZPFLvB4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)