UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8vvllodikmT1rmK6UV4OSyLFC32rKWNywFuIYSbJSKY='
WHERE
key_id = '8bc73c9d0bfb5579b18def0a93da469c9347b6bfaa0b21f872e9418f77754ec1'
AND (
token = '8vvllodikmT1rmK6UV4OSyLFC32rKWNywFuIYSbJSKY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)