UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xHCXYFL1bR6KmCTCibsFXJBAtb7vumTzrItYNy0f/BA='
WHERE
key_id = 'aebb9a81d43d567625f464e903323b44af923e6bc73f20aa2353353ba835ac11'
AND (
token = 'xHCXYFL1bR6KmCTCibsFXJBAtb7vumTzrItYNy0f/BA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)