UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9V0FgaCCI/fU8vRpVkYs1GCtj+FSqCarsngUx9cleeY='
WHERE
key_id = 'b5b352cdced367a80d527b7e5dbd340de6bd3a197e542052dc8d7ddbc1121fda'
AND (
token = '9V0FgaCCI/fU8vRpVkYs1GCtj+FSqCarsngUx9cleeY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)