UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '98rm8NFbpzwcnjob1ExZ1BYT9rzBuAZgFhWImEg+Ydw='
WHERE
key_id = '66d444f70a4d6826e4a3e9c1909a168fda88e34d00b43a1f26086f13d877fb52'
AND (
token = '98rm8NFbpzwcnjob1ExZ1BYT9rzBuAZgFhWImEg+Ydw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)