UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3GGgGoxO2Jwdw4iN/yJYQ3r3glKRr1XdNsczjgvn8+o='
WHERE
key_id = '9ca86208ee18a4d8d88fef34d4dff27d81c2cf83449d21258ce3eaf083ee9f4a'
AND (
token = '3GGgGoxO2Jwdw4iN/yJYQ3r3glKRr1XdNsczjgvn8+o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)