UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AKjetm9mKQZm3kwwIHOaDmkAdcNY7HSQFfaL608BY6o='
WHERE
key_id = '679dd9473dfb15b5b98f996ffa52f6d1c2990283af86eacaa0f7bcd1e519dd76'
AND (
token = 'AKjetm9mKQZm3kwwIHOaDmkAdcNY7HSQFfaL608BY6o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)