UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o3qUhi91w81vSQHo/+rFExK5vTCAQrrpj1PtsztWOgU='
WHERE
key_id = 'c4274642721b53aad9204d1296845ea78ee73bb6d66c17f2739ec86a89f8eef7'
AND (
token = 'o3qUhi91w81vSQHo/+rFExK5vTCAQrrpj1PtsztWOgU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)