UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C7RG/P5XFi5h30SqmcBdGjMlWI033vcMx7AlbMDeJCk='
WHERE
key_id = '9c4d6a1fd4644700a45e59e58a55778368d9c0ebca0398b7ff88145a79f0be34'
AND (
token = 'C7RG/P5XFi5h30SqmcBdGjMlWI033vcMx7AlbMDeJCk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)