UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2I1rmT3Jkzs97fvFm7AVMbWVk2tjtobkHi3jJs9v6aQ='
WHERE
key_id = '29f27c44122271beacede87e51bbc6d963422606f76fed9304bad213bfd85e3c'
AND (
token = '2I1rmT3Jkzs97fvFm7AVMbWVk2tjtobkHi3jJs9v6aQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)