UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UZIRSd9GTISmN3IxgYScPIiP2Ufo5jSHF/3rZTxRHbM='
WHERE
key_id = 'b934438f5cf3c4da893cd0b6318ec4814e209bd9d8cd9d70c0f70a6fa00c2778'
AND (
token = 'UZIRSd9GTISmN3IxgYScPIiP2Ufo5jSHF/3rZTxRHbM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)