UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kuL+3My32VDrx6XyB1d/YJwe+KfoJkjMMd6xYNlkPFc='
WHERE
key_id = '96ecbc047fa2d99c47527cfab484c073cd878072ec2614ab2f3f61bf54719279'
AND (
token = 'kuL+3My32VDrx6XyB1d/YJwe+KfoJkjMMd6xYNlkPFc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)