UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LzNWxXtir3eZWI2pDLJIJuhvAoPJJhucSjzKbndZ/8I='
WHERE
key_id = '727b1333daa0491165811d0aa5508ab6fb62ad1d327ca4a3cf44a69ac3d35cc8'
AND (
token = 'LzNWxXtir3eZWI2pDLJIJuhvAoPJJhucSjzKbndZ/8I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)