UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5b093EwH4J6E7P3h4lh2o61OxwnI/thLHEWOKeRlXw4='
WHERE
key_id = 'a5c9ce25ce6d77c1c7e73876504eeec2ea5bc1790e14a929f1b216cd8559cc2c'
AND (
token = '5b093EwH4J6E7P3h4lh2o61OxwnI/thLHEWOKeRlXw4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)