UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9rY1yX96B6SCRb1jUm0RCu8BbpSkqbLT5RxFWcOkAP4='
WHERE
key_id = '1ff6dedb9b803e39be71efdbeaf52138f01c3b41a960ed3f1b05865d9f31f9dd'
AND (
token = '9rY1yX96B6SCRb1jUm0RCu8BbpSkqbLT5RxFWcOkAP4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)