UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PyWLpcLYr2285C/LWtlR+Dm9EEUvy8fhk9YU/qwxBfg='
WHERE
key_id = 'aa1f0601b9d7e8b1e6f3743f72712c0c4581e2bade3f6a335dd60ace3c20ffa2'
AND (
token = 'PyWLpcLYr2285C/LWtlR+Dm9EEUvy8fhk9YU/qwxBfg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)