UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2T+WoT0NLqbYb6NF4tN244YxasvZFxnz/V/lPxFFR34='
WHERE
key_id = '08f5a9fff441c9827db895b93a649ba1897e8ecbf6705dc3e9c960f15e980d36'
AND (
token = '2T+WoT0NLqbYb6NF4tN244YxasvZFxnz/V/lPxFFR34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)