UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uBFNFOVmkXOwj/Ii5hVU+c4gh4uzGtWvxd3jWFrSMVQ='
WHERE
key_id = '4ee22949ea907efa7537ba2d3a4bdd1f269b22db8c3f29f403eadab678a39377'
AND (
token = 'uBFNFOVmkXOwj/Ii5hVU+c4gh4uzGtWvxd3jWFrSMVQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)