UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iFqEkkhv3+HsGyYN7M5Yj2GeT1Hb7EdxPs4r/tglSOU='
WHERE
key_id = '58f40746928d5011318671f0d3fa77ba2f3d86b6a857df98dd442a2b36ca3ab7'
AND (
token = 'iFqEkkhv3+HsGyYN7M5Yj2GeT1Hb7EdxPs4r/tglSOU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)