UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'taXgaARBbYEqDv+xIsuD78E6CexNs+XiPxDeD7+PwsY='
WHERE
key_id = '268535a3b7acc1b3f082f4c4d6c34ecd5cd720be6a250051c044f1f435b63eb2'
AND (
token = 'taXgaARBbYEqDv+xIsuD78E6CexNs+XiPxDeD7+PwsY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)