UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rBH1H7AWrfZ52CxbZiKS6DFcP45Nte+9cgxIhkvKqeA='
WHERE
key_id = '8295191e74055d012e9e023f582b8c96cd36b47bb84c06b2b8643f9a678c0cff'
AND (
token = 'rBH1H7AWrfZ52CxbZiKS6DFcP45Nte+9cgxIhkvKqeA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)