UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nHhEF5vWPkjr9L+dgn4qVycX3gNVbNWlk/RUlfcCumk='
WHERE
key_id = 'cc8aded86b6dd98594ba819aaee174c658f2056b3cdc11b68a6fd022b653c894'
AND (
token = 'nHhEF5vWPkjr9L+dgn4qVycX3gNVbNWlk/RUlfcCumk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)