UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tFMy21AhLQw7wvV622LWUVhFgMjkUScPpCUiHhrimNo='
WHERE
key_id = '69c6fa365adf2447d57108c150e60cd1ac94254e824b655dc2ac4ae6d377e0da'
AND (
token = 'tFMy21AhLQw7wvV622LWUVhFgMjkUScPpCUiHhrimNo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)