UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5VJcvvKrr3LuFCfADQO+UJwAWdFF+9oYeBtIuW3LIaQ='
WHERE
key_id = '39f1f90f1580840ea6159a34cfd18d4eec05f419811cb5341f608206cb0bf467'
AND (
token = '5VJcvvKrr3LuFCfADQO+UJwAWdFF+9oYeBtIuW3LIaQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)