UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bK+wekPzezbsLSC8K8EjuAkKtoGzsoWPQuxRPAHX/4g='
WHERE
key_id = '20afc195a134ce52ebd18b61528a15219b255b175b4ec20f6849640dbe83fa28'
AND (
token = 'bK+wekPzezbsLSC8K8EjuAkKtoGzsoWPQuxRPAHX/4g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)