UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's0aKoJr73AWmr3iYoXCMHpIoHSlGdSUG9U2EKAZabb0='
WHERE
key_id = 'd33bdaaaf13596c1f7ec4dc28776e2aa35318fdb6c926c28674056f391b16808'
AND (
token = 's0aKoJr73AWmr3iYoXCMHpIoHSlGdSUG9U2EKAZabb0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)