UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vXVkbKpJp/3829flK+ixBtZu3YkhWv3y+oTmbYqmYXU='
WHERE
key_id = 'b7b434e014806d94118795bbcd6af504bdaa6946c68819b9df99d83fb00c1697'
AND (
token = 'vXVkbKpJp/3829flK+ixBtZu3YkhWv3y+oTmbYqmYXU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)