UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9ZhZN1G8GG5o9NTL79hq5Seu5gdY2cqbXaEEcTQ2yzY='
WHERE
key_id = '308948ce67cfa26ac63d14dba9e12880d87bb7deae4e1088e2f1ed14391e638b'
AND (
token = '9ZhZN1G8GG5o9NTL79hq5Seu5gdY2cqbXaEEcTQ2yzY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)