UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j5nfSm8K8kmNFh0CG1kCRMBuZxyLn+uGrBLO9TS6b00='
WHERE
key_id = '5db18cbbb148ca07e648d9d07524b4b86872cc7856fbada3b1664145424dec33'
AND (
token = 'j5nfSm8K8kmNFh0CG1kCRMBuZxyLn+uGrBLO9TS6b00='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)