UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9EdvhhezjZHTSzBW5UYl9/1Q5c2uwH/Z3ONREAs50zc='
WHERE
key_id = '73bd1ade9c4aed238d44430e2cb3c97da37f16d554072cd65b99c5a97bad7e0a'
AND (
token = '9EdvhhezjZHTSzBW5UYl9/1Q5c2uwH/Z3ONREAs50zc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)