UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZRObx0EXk99ge3bUb7W706uwfvaV3eQDUyfS2JAQTfc='
WHERE
key_id = '845b910530556d0cfb3ad1d7e637f87e7ed9ee2d09dfa4e991754307cd22ef6a'
AND (
token = 'ZRObx0EXk99ge3bUb7W706uwfvaV3eQDUyfS2JAQTfc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)