UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A8Z8Q/ghnQEi2O6CgGAbFhEiFeDjn/KyBLpz1GeuFOA='
WHERE
key_id = '82189177a20ccae33c54fd94cb9a8f8fb72e1285ab8332e1ba2c7d42796b549e'
AND (
token = 'A8Z8Q/ghnQEi2O6CgGAbFhEiFeDjn/KyBLpz1GeuFOA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)